package com.iampzh.springvue.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
//@Configuration
public class MyWebConfig implements WebMvcConfigurer {


        @Override
        public void addResourceHandlers(ResourceHandlerRegistry registry) {
            //将所有g:/iampzh/fileupload/目录下的资源,访问时都映射到/res/** 路径下
            registry.addResourceHandler("/file/**")
                    .addResourceLocations("classpath:/META-INF/resources/", "classpath:/resources/",
                            "classpath:/static/", "classpath:/public/", "file:g:/iampzh/fileupload/");
        }

    }


